package com.woniu.order.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.redis.stream.Task;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "work-server",path = "/workflow")
public interface ZfWorkFeign {
    // 部署
    @PostMapping("/deploy")
    String deployProcess();

    // 启动流程
    @PostMapping("/start")
    String startProcess(@RequestParam("processDefinitionKey") String processDefinitionKey, @RequestBody Map<String, Object> variables);

    // 查询用户代办任务
    @GetMapping("/tasks")
    List<Task> getTasks(@RequestParam("assignee") String assignee);

    // 完成审批
    @PostMapping("/approve")
    void approveTask(@RequestParam("taskId") String taskId, @RequestBody Map<String, Object> variables);
}